package maksb.logger;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MessageFormatter {
    private static DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss:SSS");
    private static String TEMPLATE = "%s %s %s %s: %s\n";
    
    public static String format(String loggerName, LoggerLevel level, String msg) {
        return String.format(TEMPLATE, dateFormat.format(new Date()),
                                       level,
                                       Thread.currentThread().getName(),
                                       loggerName,
                                       msg);
    }
}
